<!doctype html>
<html>
<head>
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset="utf-8">
    <title>{$siteTitle}</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
    <link rel="shortcut icon" href="common/statics/images/favicon.ico" />
    <link rel="stylesheet" href="common/statics/css/vendor.css" />
    <link rel="stylesheet" href="common/statics/css/bootstrap.css" />
    <link rel="stylesheet" href="common/statics/css/ace.css" />
    <link rel="stylesheet" href="common/statics/css/font-awesome.css" />
    <link rel="stylesheet" href="common/statics/css/main.css">
    <link rel="stylesheet" href="common/statics/css/angular-motion.css">
    <link rel="stylesheet" href="{:U('FrontendRuntime/index?action=getCss')}" />
    <base href="{$APP_PATH}" />
</head>
<body ng-controller="MainCtl" ng-keydown="doMainKeyDown($event)">
<div class="navbar navbar-default" id="navbar">
    <div class="navbar-container" id="navbar-container">
        <div class="navbar-header pull-left">
            <a ng-click="sidebarToggleExpand()" class="topest_toggle_sidebar_btn">
                <i class="icon fa-list-ul"></i>
            </a>
            <a ng-click="$root.goPage('/')" class="navbar-brand"></a><!-- /.brand -->
        </div><!-- /.navbar-header -->

        <div class="navbar-header pull-right navbar-user" role="navigation">
            <ul class="nav ace-nav">
                {:tag("nav_bar_dropdown_html")}
                <li class="topSetting" id="topest_setting_btn">
                    <a ng-click="$root.goPage('systemPreference')">
                        <i class="icon fa-cog"></i>
                        <span class="badge badge-important ng-binding ng-hide" ng-bind="reminds.length" ng-show="reminds.length>0">0</span>
                    </a>
                </li>
                <li>
                    <a ng-click="$root.goPage('department/Logout')">
                        <i class="icon fa-power-off"></i>
                    </a>
                </li>
            </ul><!-- /.ace-nav -->
        </div><!-- /.navbar-header -->
    </div><!-- /.container -->
</div>


<div class="main-container" id="main-container">
    <div class="main-container-inner">
        <a class="menu-toggler" id="menu-toggler" href="#">
            <span class="menu-text"></span>
        </a>

        <div class="sidebar" id="sidebar" ng-class="{'menu-min':expand!==true}">
            <div class="sidebar-shortcuts" id="sidebar-shortcuts">
                <div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
                    <div class="row">
                        <div class="col-xs-4">
                            <a ng-click="$root.goPage('/my/preference')">
                                <img class="nav-user-photo" ng-src="./uploads/Avatars/avatar.php?email={{userInfo.email}}&s=50" />
                            </a>
                        </div>
                        <div class="col-xs-8">
                            <a ng-click="$root.goPage('my/preference')"><i class="icon fa-cog"></i></a>
                            <a ng-click="$root.goPage('department/Logout')"><i class="icon fa-power-off"></i></a>
                        </div>
                    </div>
                </div>

                <div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
                    <a ng-click="$root.goPage('/my/preference')">
                        <img class="nav-user-photo" ng-src="./uploads/Avatars/avatar.php?email={{userInfo.email}}&s=50" />
                    </a>
                </div>
            </div><!-- #sidebar-shortcuts -->

            <ul id="nav-list" class="nav nav-list" ng-controller="CommonSidebarCtl">
                <li ng-repeat="nav in navs" ng-class="{'active': nav.id==activeShowNav}">
                    <a ng-class="{'dropdown-toggle' : nav.childs.length}" ng-click="checkActiveNav($index, nav.id);$root.goPage(nav.url)">
                        <i class="fa-{{nav.icon}}"></i>
                        <span class="menu-text" ng-bind="'lang.navs.'+nav.label|lang"></span>
                        <b class="arrow fa-angle-down" ng-show="{{nav.childs.length}}"></b>
                    </a>
                    <ul class="submenu">
                        <li ng-repeat="nc in nav.childs" ng-class="{'active':nc.id==activeSubNav}">
                            <a ng-click="checkSubActiveNav(nc.id, nav.id);$root.goPage(nc.url)">
                                <i class="fa-angle-double-right"></i>
                                <span class="menu-text" ng-bind="'lang.navs.'+nc.label|lang"></span>
                            </a>
                            <ul class="submenu">
                                <li ng-repeat="nct in nc.childs" ng-class="{'active':nct.id == activeThirdNav}">
                                    <a ng-click="checkThirdActiveNav(nct.id, nc.id);$root.goPage(nct.url)">
                                        <i class="fa-angle-double-right"></i>
                                        <span class="menu-text" ng-bind="'lang.navs.'+nct.label|lang"></span>
                                    </a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
            </ul>

            <div class="sidebar-collapse" ng-click="sidebarToggleExpand()">
                <i class="icon" ng-class="{'fa-angle-double-right':expand!==true,'fa-angle-double-left':expand===true}"></i>
            </div>
        </div>

        <div class="main-content">
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li>
                        <i class="fa-home home-icon"></i>
                        <a ng-click="$root.goPage('DASHBOARD')" ng-bind="'lang.dashboard'|lang"></a>
                    </li>
                    <li ng-bind="currentPage.lang.app"></li>
                    <li class="active" ng-bind="currentPage.lang.module" ng-show="currentPage.lang.module"></li>
                    <li class="active" ng-bind="currentPage.lang.action" ng-show="currentPage.lang.action"></li>
                </ul><!-- .breadcrumb -->

                <div class="nav-search" ng-controller="multiSearchCtl">
                    <span class="input-icon">
                        <input type="text"
                               id="multiSearchInput"
                               placeholder="Search ..."
                               class="nav-search-input"
                               autocomplete="off"
                               ng-model="keyword"
                               ng-model-options="{debounce:300}"
                               ng-keydown="doSearchKeydown($event)"
                               ng-blur="doSearchBlur($event)"
                               ng-focus="doSearchFocus($event)" />
                        <i class="fa-search nav-search-icon"></i>
                    </span>

                </div><!-- #nav-search -->
            </div>
            <div class="progress loadingStateBar" id="loadingStateBar">
                <div class="progress-bar" id="loadingStateBarProgress"></div>
            </div>
            <div id="alerts-container"></div>

            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12 am-fade-and-scale" ng-view></div>
                </div>
                <hr class="hr-10 hr-double" />
                <div class="row footer-copy">
                    <p class="text-center">
                        &copy; 2014 Present by <a href="http://www.ng-erp.com" target="_blank">ONES Team</a>
                        v{:DBC('system.version')}
                    </p>
                </div>
                <!--//demo-->
            </div><!-- /.page-content -->
        </div><!-- /.main-content -->

    </div><!-- /.main-container-inner -->
</div><!-- /.main-container -->

<div class="bottomAlertContainer" id="bottomAlertContainer"></div>

<ul class="ui-menu ui-widget ui-widget-content ui-corner-all contextMenuDropdown ng-hide"
    role="menu"
    ng-show="contextMenu.items.length>0"
    id="contextMenuDropdown"
    style="left:{{contextMenu.left||-9999}}px;top:{{contextMenu.top||-9999}}px;">
    <li ng-repeat="act in contextMenu.items track by $index" class="ui-menu-item" role="presentation">
        <a tabindex="-1"
           class="ui-corner-all"
           ng-click="act.action(null,contextMenu.selectedItems,contextMenu.currentItem);hideContextMenu();">
            <i class="icon fa-{{act.icon}}"></i>
            <span ng-bind="act.label"></span>
           </a>
    </li>
</ul>
<script type="text/javascript">
    var ones = {
        BaseConf: {
            LoadedApps: {$loadedAppsStr},
            DEBUG: {$isDebug}
        },
        basePath: '{$APP_PATH}',
        userInfo: {$userInfo},
        asyncScript: [],
    };
    <if condition="DBC('site.html5.mode')">
        ones.useHTML5 = {:DBC('site.html5.mode')};
    </if>
</script>
<foreach name="javascripts" item="js">
    <script src="{$js}"></script>
</foreach>

<script type="text/javascript">
    /**
     * i18n
     * */
     jQuery(function(){
         /**
          * 加载语言包
          * */
         ones.i18n = ones.caches.getItem("ones.i18n");
         if((!ones.i18n || isEmptyObject(ones.i18n)) && !ones.installing) {
             jQuery.get(ones.BaseConf.BSU+"FrontendRuntime/index/action/getI18n/lang/zh-cn").success(function(data) {
                 ones.caches.setItem("ones.i18n", data, 1);
                 ones.i18n = ones.caches.getItem("ones.i18n");
                 if(!ones.i18n) {
                     throw("can't load i18n package.");
                 }

                 angular.element(document).ready(function() {
                     angular.bootstrap(document, ['ones']);
                 });
             });
         } else {
             angular.element(document).ready(function() {
                 angular.bootstrap(document, ['ones']);
             });
         }
     });
</script>
</body>
</html>